<template>
  <div id="contentRight">
    <section id="sec1">
      <p class="guide">
        <router-link to="/safeCenter">账户&安全&nbsp;&nbsp;>&nbsp;</router-link>
        <span>BHpay授权</span>
      </p>
      <p class="p2">
        <img src="../common/imgs/radiusSuccess.png" alt="">
      </p>
      <p class="p3">已关联BHPay账户</p>
      <div class="d4">
        <p>
          <span>账户：</span>
          <span>{{data.card_num}}</span>
          <span class="hoverhand copy" :data-clipboard-text="data.card_num" id="copy1" @click="copyInfo('#copy1')">复制</span>
        </p>
        <p>
          <span>姓名：</span>
          <span>{{data.name}}</span>
        </p>
      </div>
      <p class="p5">
        <router-link to="/outCoins">去人人矿场提币</router-link>
      </p>
      <p class="p6">
        <a :href="data.down_uri" target="_blank">下载BHpay钱包开启新体验</a>
      </p>
    </section>
  </div>
</template>
<script>
  import {bhpayMes} from "../http/api";
  export default {
    name : 'bhpayInfo',
    data(){
      return {
        data : {},
        openBhpay : false,
      }
    },
    mounted() {
      let thiz = this;
      let Not = {noToast: true, noLoading: true};
      bhpayMes(Not).then( res => {
        thiz.openBhpay = res.code == 200 ? true : false;
        if( res.code == 200 ){
          let data = res.data || false;
          if( data && JSON.stringify(data) != '{}' ){
            thiz.openBhpay = true;
            this.data = data;
          } else{
            thiz.openBhpay = false;
          }
        }else{
          thiz.openBhpay = false;
        }
      })
    },
    methods:{
      copyInfo(id){
        require('../common/js/copy').copy({id: id , toast: '复制成功'});
      },
    }
  }
</script>
<style lang="less" scoped>
  @import "../common/style/common";
  @import "../common/style/public.css";
  #sec1{
    min-height: 725px;
    >.p2{
      text-align: center;padding-top: 94px;
      >img{
        width: 50px;
      }
    }
    >.p3{
      text-align: center;.colorYellow;font-size: 20px;padding-top: 17px;
    }
    >.d4{
      width: 434px;margin: 0 auto;margin-top: 24px;background: #F8F8F8;.borderRadius;padding: 28px 28px;
      >p{
        overflow: hidden;padding-top: 19px;
        >span{
          float: left;font-size: 14px;color: #595959;
        }
        &:first-child{
          padding-top: 0px;
        }
        &:nth-child(2){
          padding-bottom: 5px;
        }
        >.copy{
          .colorYellow;float: right;
          &:hover{
            cursor: pointer;
          }
        }
      }
    }
    >.p6{
      padding-top: 17px;
      >a{
        .submit;.bgYellow;color: #fff;
      }
    }
    >.p5,>.p6{
      text-align: center;
      >a{
        display: inline-block;height: 38px;line-height: 38px;text-align: center;font-size: 14px;width: 434px;.borderRadius;
      }
    }
    >.p5{
      padding-top: 33px;
      >a{
        .borderYellow;.colorYellow;
      }
    }
  }
</style>
